package com.sls.nzdapplication.model;

import com.alibaba.fastjson.JSONObject;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;

import java.util.Date;
import org.greenrobot.greendao.annotation.Generated;

@Entity
public class MeterBox {

    @Id
    private String id;

    private String boxCode ;

    private String boxName;

    private String cellUnit;

    private String type;

    private int code;

    private String material;

    private String hiddenDangerInformation;

    private int row;

    private int column;

    //经度
    private Double lon;

    //纬度
    private Double lat;

    private Date createTime;

    private String createBy;

    private Date modifyTime;

    private String modifyBy;

    private String previousEquipmentId;

    //设备状态
    private String sbzt;

    //缺陷信息
    private String qxxx;

    private String areaId;

    public JSONObject toJson(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id",this.id);
        jsonObject.put("code",this.code);
        jsonObject.put("createTime",this.createTime);
        jsonObject.put("createBy",this.createBy);
        jsonObject.put("modifyTime",this.modifyTime);
        jsonObject.put("modifyBy",this.modifyBy);
        jsonObject.put("boxCode",this.boxCode);
        jsonObject.put("boxName",this.boxName);
        jsonObject.put("cellUnit",this.cellUnit);
        jsonObject.put("type",this.type);
        jsonObject.put("material",this.material);
        jsonObject.put("hiddenDangerInformation",this.hiddenDangerInformation);
        jsonObject.put("row",this.row);
        jsonObject.put("column",this.column);
        jsonObject.put("lon",this.lon);
        jsonObject.put("lat",this.lat);
        jsonObject.put("previousEquipmentId",this.previousEquipmentId);
        jsonObject.put("sbzt",this.sbzt);
        jsonObject.put("qxxx",this.qxxx);
        jsonObject.put("areaId",this.areaId);
        return jsonObject;
    }

    public MeterBox(JSONObject jsonObject){
        this.id = jsonObject.getString("id");
        this.code = jsonObject.getIntValue("code");
        this.createTime = jsonObject.getDate("createTime");
        this.createBy = jsonObject.getString("createBy");
        this.modifyTime = jsonObject.getDate("modifyTime");
        this.modifyBy = jsonObject.getString("modifyBy");
        this.boxCode = jsonObject.getString("boxCode")==null?"":jsonObject.getString("boxCode");
        this.boxName = jsonObject.getString("boxName")==null?"":jsonObject.getString("boxName");
        this.cellUnit = jsonObject.getString("cellUnit")==null?"":jsonObject.getString("cellUnit");
        this.type = jsonObject.getString("type")==null?"":jsonObject.getString("type");
        this.material = jsonObject.getString("material")==null?"":jsonObject.getString("material");
        this.hiddenDangerInformation = jsonObject.getString("hiddenDangerInformation")==null?"":jsonObject.getString("hiddenDangerInformation");
        this.row = jsonObject.getIntValue("row");
        this.column = jsonObject.getIntValue("column");
        this.lon = jsonObject.getDouble("lon");
        this.lat = jsonObject.getDouble("lat");
        this.previousEquipmentId = jsonObject.getString("previousEquipmentId")==null?"":jsonObject.getString("previousEquipmentId");
        this.sbzt = jsonObject.getString("sbzt")==null?"":jsonObject.getString("sbzt");
        this.qxxx = jsonObject.getString("qxxx")==null?"":jsonObject.getString("qxxx");
        this.areaId = jsonObject.getString("areaId")==null?"":jsonObject.getString("areaId");
    }


    @Generated(hash = 2028961094)
    public MeterBox(String id, String boxCode, String boxName, String cellUnit,
            String type, int code, String material, String hiddenDangerInformation,
            int row, int column, Double lon, Double lat, Date createTime,
            String createBy, Date modifyTime, String modifyBy,
            String previousEquipmentId, String sbzt, String qxxx, String areaId) {
        this.id = id;
        this.boxCode = boxCode;
        this.boxName = boxName;
        this.cellUnit = cellUnit;
        this.type = type;
        this.code = code;
        this.material = material;
        this.hiddenDangerInformation = hiddenDangerInformation;
        this.row = row;
        this.column = column;
        this.lon = lon;
        this.lat = lat;
        this.createTime = createTime;
        this.createBy = createBy;
        this.modifyTime = modifyTime;
        this.modifyBy = modifyBy;
        this.previousEquipmentId = previousEquipmentId;
        this.sbzt = sbzt;
        this.qxxx = qxxx;
        this.areaId = areaId;
    }

    @Generated(hash = 36967554)
    public MeterBox() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBoxCode() {
        return this.boxCode;
    }

    public void setBoxCode(String boxCode) {
        this.boxCode = boxCode;
    }

    public String getBoxName() {
        return this.boxName;
    }

    public void setBoxName(String boxName) {
        this.boxName = boxName;
    }

    public String getCellUnit() {
        return this.cellUnit;
    }

    public void setCellUnit(String cellUnit) {
        this.cellUnit = cellUnit;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMaterial() {
        return this.material;
    }

    public void setMaterial(String material) {
        this.material = material;
    }

    public String getHiddenDangerInformation() {
        return this.hiddenDangerInformation;
    }

    public void setHiddenDangerInformation(String hiddenDangerInformation) {
        this.hiddenDangerInformation = hiddenDangerInformation;
    }

    public int getRow() {
        return this.row;
    }

    public void setRow(int row) {
        this.row = row;
    }

    public int getColumn() {
        return this.column;
    }

    public void setColumn(int column) {
        this.column = column;
    }

    public Double getLon() {
        return this.lon;
    }

    public void setLon(Double lon) {
        this.lon = lon;
    }

    public Double getLat() {
        return this.lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getModifyTime() {
        return this.modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getModifyBy() {
        return this.modifyBy;
    }

    public void setModifyBy(String modifyBy) {
        this.modifyBy = modifyBy;
    }

    public String getPreviousEquipmentId() {
        return this.previousEquipmentId;
    }

    public void setPreviousEquipmentId(String previousEquipmentId) {
        this.previousEquipmentId = previousEquipmentId;
    }

    public String getSbzt() {
        return this.sbzt;
    }

    public void setSbzt(String sbzt) {
        this.sbzt = sbzt;
    }

    public String getQxxx() {
        return this.qxxx;
    }

    public void setQxxx(String qxxx) {
        this.qxxx = qxxx;
    }

    public String getAreaId() {
        return this.areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }



}
